//
//  ZPFUserManager.h
//  ZPFHimalayan
//
//  Created by zhou on 2018/11/23.
//  Copyright © 2018 MissZhou. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ZPFUserInfo.h"

//NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, UserLoginType){
    UserLoginTypeIsUnKnow = 0,  //未知
    UserLoginTypeIsWeChat,      //微信登录
    UserLoginTypeIsQQ,          //QQ登录
    UserLoginTypeIsAccount,     //帐号登录
};

typedef void(^loginBlock)(BOOL success, NSString *message);

/**
 包含用户相关服务
 */
@interface ZPFUserManager : NSObject

//当前用户
@property (strong, nonatomic) ZPFUserInfo *currentUserInfo;
@property (assign, nonatomic) UserLoginType userLoginType;
@property (assign, nonatomic) BOOL isLogin;

/* 单例*/
SINGLETON_FOR_HEADER(ZPFUserManager)

#pragma mark - 登录相关

/**
 第三方登录

 @param loginType 登录方式
 @param completion 回调
 */
- (void)login:(UserLoginType)loginType completion:(loginBlock)completion;

/**
 带参登录（手机号、验证码、密码等等）

 @param loginType y登录方式
 @param params 参数 手机和账号登录按需要
 @param completion 回调
 */
- (void)login:(UserLoginType)loginType params:(NSDictionary *)params completion:(loginBlock)completion;

/**
 自动登录

 @param completion 回调
 */
- (void)autoLoginToService:(loginBlock)completion;

/**
 退出登录

 @param completion 回调
 */
- (void)logout:(loginBlock)completion;


/**
 加载缓存h用户数据

 @return 是否成功
 */
- (BOOL)lodingUserInfo;
@end

//NS_ASSUME_NONNULL_END
